feat: update ChatCompletionResponseFormatJSONSchema to use jsonschema…#927
feat: update ChatCompletionResponseFormatJSONSchema to use jsonschema…#927alejandrojnm wants to merge 2 commits into
Conversation
….Definition this will fix the issue #884 Signed-off-by: alejandrojnm <alejandrojnm@gmail.com>
…o github.com/alejandrojnm/go-openai Signed-off-by: alejandrojnm <alejandrojnm@gmail.com>
|
@sashabaranov this in fact fixes the critical issue that blocks clients from properly using the Structured Outputs. Could you please check this out? |
|
@alejandrojnm I beg you please do not do this. Please refer to issues #819 and #824 for examples of why forcing If you need |
|
I will try to fix that @gspeicher thanks for point in the right directions |
Describe the change
This pull request includes changes to the
chat.gofile to integrate thejsonschemapackage for handling JSON schemas in chat completion responses. The most important changes include adding the new import and updating the type of theSchemafield in theChatCompletionResponseFormatJSONSchemastruct.Integration of
jsonschemapackage:chat.go: Added thejsonschemapackage to the import list.chat.go: Changed theSchemafield type in theChatCompletionResponseFormatJSONSchemastruct fromjson.Marshalertojsonschema.Definition.Improvements to JSON schema handling:
chat.go: Added thejsonschemapackage to the imports.chat.go: Changed theSchemafield type in theChatCompletionResponseFormatJSONSchemastruct fromjson.Marshalertojsonschema.Definition. or what feature it adds.Provide OpenAI documentation link
Provide a relevant API doc from https://platform.openai.com/docs/api-reference
Describe your solution
The solution was use jsonschema.Definition
Tests
Nothing to test, all the tests pass locally
Issue: #884